package cn.xinfei.xdecision.common.service.component.guiderule;

import cn.xinfei.xdecision.common.model.common.requestParam.UpdateStatusParam;
import cn.xinfei.xdecision.common.model.component.CopyToFolderReqVo;
import cn.xinfei.xdecision.common.model.component.guiderule.RuleInfo;
import cn.xinfei.xdecision.common.model.component.guiderule.vo.RuleListReqVo;
import cn.xinfei.xdecision.common.model.component.guiderule.vo.RuleVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface RuleService extends IService<RuleInfo> {

    /**
     * 新增规则
     * @param rule
     * @return
     */
    RuleVo insertRuleInfo(RuleVo rule);

    /**
     * 删除规则
     * @param ids
     */
    void logicalDeleteRules(List<Long> ids);

    /**
     * 更新规则
     * @param rule
     * @return
     */
    RuleVo updateRuleInfo(RuleVo rule);

    /**
     * 更新规则状态
     * @param updateStatusReqVo
     * @return
     */
    boolean updateStatus(UpdateStatusParam updateStatusReqVo);

	/**
	 * 更新规则文件夹id
	 * @param ids
	 * @param parentId
	 * @return
	 */
    boolean updateParent(List<Long> ids, Long parentId);

	/**
	 * 根据id查询规则
	 * @param id
	 * @return
	 */
	RuleVo queryById(Long id);

	/**
	 * 根据规则编码查询
	 * @param code
	 * @return
	 */
	RuleInfo queryByCode(String code);
	RuleInfo queryByCode(String code,Long versionNo);

	/**
	 * 规则列表
	 * @param ruleListReqVo
	 * @return
	 */
    PageInfo getRuleList(RuleListReqVo ruleListReqVo);

	/**
	 * 复制规则
	 * @param copyToFolderReqVo
	 * @return
	 */
	void copyRule(CopyToFolderReqVo copyToFolderReqVo);

	/**
	 * 根据id查询规则列表
	 * @param ruleIds
	 * @return
	 */
    List<RuleInfo> getRuleList(List<Long> ruleIds);

	/**
	 * 查询文件夹下规则列表
	 * @param folderId
	 * @return
	 */
	List<Long> queryByFolderId(@Param("folderId") Long folderId);
}
